#pragma once
#include <cstring>
#include "const.h"

class MsgNode
{
public:
    MsgNode(short max_len)
    :_cur_len(0),_total_len(max_len)
    {
        _data = new char[_total_len+1];
        memset(_data,0,_total_len+1);
    }
    ~MsgNode()
    {
        delete[] _data;
    }
    void Clear()
    {
        memset(_data,0,_total_len+1);
        _cur_len = 0;
        
    }


    short _cur_len;
    short _total_len;
    char *_data;
};


class RecvMsgNode : public MsgNode
{
    
public:
    RecvMsgNode(short max_len,short msg_id);

public:

    short _msg_id;

};

class SendMsgNode : public MsgNode
{
public:
    SendMsgNode(const char* msg, short max_len,short msg_id);

public:

    short _msg_id;
};